"==================="
"        vim        "
"==================="
if &compatible
	" vint: -ProhibitSetNoCompatible
	set nocompatible  " I don't need vi mode
	" vint: +ProhibitSetNoCompatible
endif
" file setting
set encoding=utf-8
filetype on
filetype indent on
filetype plugin on
filetype plugin indent on
set updatetime=10  " set update time
let &t_ut=''
set swapfile
set encoding=utf-8
set autoindent
set backspace=eol,start,indent
set laststatus=2
set tabstop=2  " set tab = 4"
" key settings
set list " show space"
set listchars=tab:▸\ ,trail:▫  "set show tab and space"
set backspace=indent,eol,start
" code
set foldmethod=indent
" set numbers
set number  "open number of rows
set relativenumber " open relative number
set cursorline  "highlight current line
set cursorcolumn "highlight current columns
set scrolloff=10
"search settings
syntax on  "open highlight
set showcmd  " show command
set wildmenu  "noremal mode completion
set hlsearch  "highlight all search results
execute "nohlsearch"
set incsearch  "highlight all search results
set ignorecase  "don't case sensitive
set smartcase
set clipboard=unnamedplus
set timeoutlen=200
" status line setting
set termguicolors
highlight Visual guibg=#323232
" mouse setting
"set mouse=a

"===================="
"   vim-key setting  "
"===================="
source ~/.config/nvim/core/map.vim


"search tow word
map <LEADER>F /\(\<\W\+\>\)\_s*\1  " search tow word
map <LEADER>ss :set spell!<CR>  "open Grammar check
" functinon key to config
" Compile function
noremap r :call CompileRunGcc()<CR>
func! CompileRunGcc()
	exec "w"
	if &filetype == 'c'
		exec "!g++ % -o %<"
		exec "!time ./%<"
	elseif &filetype == 'cpp'
		set splitbelow
		exec "!g++ -std=c++11 % -Wall -o %<"
		:sp
		:res -15
		:term ./%<
	elseif &filetype == 'java'
		exec "!javac %"
		exec "!time java %<"
	elseif &filetype == 'sh'
		:!time bash %
	elseif &filetype == 'python'
		set splitbelow
		:sp
		:term python3 %
	elseif &filetype == 'html'
		silent! exec "!".g:mkdp_browser." % &"
	elseif &filetype == 'markdown'
		exec "InstantMarkdownPreview"
	elseif &filetype == 'go'
		set splitbelow
		:sp
		:term go run .
	endif
endfunc
" One keyboard operation run conde
